// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import '../static/style/style.css'
import '../static/javascript/swiper-3.4.2.min.css'
import $ from 'jquery'

Vue.config.productionTip = false
router.beforeEach(function(to, from, next) {
        if (to.path == '/') {
            next();
        }
        if (to.path == '/login' || to.path == '/kf' || to.name == "home" || to.path == '/reg') {
            next();
        } else {
            if (window.localStorage.Uname && window.localStorage.pass) {
                next();
            } else if (!window.localStorage.Uname && window.localStorage.pass) {
                next({ path: '/' });
            } else {
                next({ path: '/' })
            }
        }

    })
    /* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    template: '<App/>',
    components: { App }
})